package com.atshiyou.Util;

//用来定义SQL
public class SqlUtil {

    // 返回值一定要是字符串
    public String insertMethod(){
        return "insert into student(stuname,stuage,gid) values (#{stuName},#{stuAge},#{gid})";
    }

    public String deleteMethod(){
        return "delete from student where stuid = #{sid}";
    }

    public String updateMethod(){
        return "update student set stuname=#{stuName},stuage=#{stuAge},gid=#{gid} where stuid=#{stuId}";
    }

    public String findAllMethod(){
        return "select * from student";
    }

    public String totalCountMethod(){
        return "select count(*) from student";
    }

    public String total2Method(){
        return "select Max(stuid) max,Min(stuid) min,Avg(stuid) avg from student";
    }



}
